
version 17
use "data_schooling.dta"

*******************************************************************************
*******************************************************************************

* Table 1, column 1-3
sum high_track_grade5 if high_SES == 0
reg high_track_grade5 high_SES i.location, r
reg high_track_grade5 high_SES  sex i.age i.location, r
reg high_track_grade5 high_SES  sex i.age i.location GPA_elemenatary , r

* Table 1, column 4-6
sum high_track_grade910 if high_SES == 0 
reg high_track_grade910 high_SES i.location, r
reg high_track_grade910 high_SES  sex i.age i.location, r
reg high_track_grade910 high_SES  sex i.age i.location GPA_elemenatary , r


*******************************************************************************
*******************************************************************************


* Figure 1, Panel A, Bars
qui reg high_track_grade5 ibn.group##i.location, noc r
margins group, level(`=round((normal(1)-normal(-1))*100,.01)') 

* Figure 1, Panel A, mean comparison, base: Control Low SES
qui reg high_track_grade5 i.group##i.location, r
margins, dydx(i.group)  

* Figure 1, Panel B (upper part, Table A8)
sum high_track_grade5 if treatment == 0
reg high_track_grade5 treatment, absorb(strata) r
reg high_track_grade5 treatment sex i.age , absorb(strata) r
reg high_track_grade5 treatment sex i.age GPA_elemenatary, absorb(strata) r

* Figure 1, Panel B (lower part, Table A9)
sum high_track_grade910 if treatment == 0 
reg high_track_grade910 treatment, absorb(strata) r
reg high_track_grade910 treatment  sex i.age , absorb(strata) r
reg high_track_grade910 treatment  sex i.age GPA_elemenatary, absorb(strata) r